#! /bin/bash

# (c) Thomas Lange, 2001-2012, lange@debian.org

error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
#listen internal nic only
[ -n "$IPADDR" ] && sed -i s/#\ ListenIP=0.0.0.0/ListenIP=$IPADDR/ $target/etc/zabbix/zabbix_agentd.conf
[ -n "$ZABBIXSRV" ] && sed -i s/Server=127.0.0.1/Server=$ZABBIXSRV/ $target/etc/zabbix/zabbix_agentd.conf
sed -i 's/^ServerActive/#ServerActive/' $target/etc/zabbix/zabbix_agentd.conf
sed -i 's/^Hostname/#Hostname/' $target/etc/zabbix/zabbix_agentd.conf
$ROOTCMD chkconfig zabbix-agent on

exit $error
